import {createRouter, createWebHistory} from 'vue-router'
import Login from "../views/Login";
import Register from "../views/Register";
// 首页
import Index from '../views/student/index/Index'
// 填写申报书
import Declaration from '../views/student/index/Declaration'
// 我的活动
import Mydeclare from '../views/student/declare/Mydeclare'
// 我的收藏
import Collection from '../views/student/declare/Collection'
// 已提交
import Submitted from '../views/student/declare/Submitted'
// 已申报
import Declared from '../views/student/declare/Declared'
// 待审核
import State from '../views/student/state/State'
// 已审核
import Stated from '../views/student/state/Stated'
// 项目意见
import Advice from '../views/student/advice/Advice'

// 个人信息
import Information from '../views/student/my/Information'
// 修改密码
import Editpwd from '../views/student/my/Editpwd'

/*学生用户菜单*/
import StudentHome from '../views/student/StudentHome'

// 审批人员首页
import Exaindex from '../views/teacher/release/Exaindex'
// 活动发布
import PublishActivity from '../views/teacher/release/PublishActivity'
// 我的发布
import Myrelease from '../views/teacher/release/Myrelease'
// 我已审批
import Checked from '../views/teacher/check/Checked'
// 我需审批
import Check from '../views/teacher/check/Check'
// 图表
import Circumstance from '../views/teacher/circumstance/Circumstance'
import Deptecharts from '../views/teacher/circumstance/Deptecharts'
// 修改密码
import Exaeditpwd from '../views/teacher/my/Exaeditpwd'
// 个人资料
import My from '../views/teacher/my/My'
/*审核人员菜单*/
import TeacherHome from '../views/teacher/TeacherHome'

/*党员信息*/
import MsgHome from '../views/teacher/member/Msg'
/*党员信息*/
import AccountHome from '../views/teacher/member/Account'

// 管理员
import Admin_login from '../views/Admin_login'
// 管理员菜单
import AdminHome from '../views/admin/AdminHome'
// 管理员首页
import AdminIndex from '../views/admin/AdminIndex'
// 添加审核人员
import Add_exa from '../views/admin/Add_exa'
// 全部审核人员
import All from '../views/admin/All'

const empty = {
    render() {
        return (
              <router-view/>
        )
    },
}

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    {
        path: '/admin',
        name: 'Admin_login',
        component: Admin_login
    },
    {
        path: '/404',
        name: '404',
        component: () => import(/* webpackChunkName: "about" */ '../views/404.vue')
    },
    {
        path: '/register',
        name: 'Register',
        component: Register
    },
    /*学生用户界面*/
    {
        path: '/colHome',
        component: StudentHome,
        redirect: '/index',
        children: [
            {path: '/index', component: Index},
            {path: '/declaration', component: Declaration,name:'declaration',meta: {title: '申请项目'}},//可删除
            {
                path: '/e',
                meta: {title: '我的活动'},
                component: empty,
                children: [
                    {path: '/collection', component: Collection, meta: {title: '我的收藏'}},
                    {path: '/mydeclare', component: Mydeclare, meta: {title: '全部'}},//可删除
                    {path: '/submitted', component: Submitted, meta: {title: '已提交'}},//可删除
                    {path: '/declared', component: Declared, meta: {title: '已申报'}},//可删除
                ]
            },
            {
                path: '/e',
                meta: {title: '审核状态'},
                component: empty,
                children: [
                    {path: '/state', component: State, meta: {title: '活动待审核'}},
                    {path: '/stated', component: Stated, meta: {title: '已发布结果'}},
                ]
            },
            {path: '/advice', component: Advice, meta: {title: '查看意见'}},
            {
                path: '/e',
                meta: {title: '个人信息'},
                component: empty,
                children: [
                    {path: '/information', component: Information, meta: {title: '个人资料'}},
                    {path: '/editpwd', component: Editpwd, meta: {title: '密码修改'}},
                ]
            },
        ]
    },
    /*审核人员界面*/
    {
        path: '/exaHome', component: TeacherHome,
        redirect: '/exaindex',
        children: [
            {path: '/exaindex', component: Exaindex},
            {path: '/myrelease', component: Myrelease,meta: {title: '我的发布'}},
            {path: '/publishActivity', component: PublishActivity,meta: {title: '发布活动'}},
            {
                path: '/e',
                meta: {title: '党员管理'},
                component: empty,
                children: [
                    {path: '/msg', component: MsgHome,meta: {title: '党员信息'}},
                    {path: '/account', component: AccountHome,meta: {title: '党员账号'}},
                ]
            },
            {
                path: '/e',
                meta: {title: 'test'},
                component: empty,
                children: [
                   
                ]
            },
            {
                path: '/e',
                meta: {title: '个人信息'},
                component: empty,
                children: [
                    {path: '/exaeditpwd', component: Exaeditpwd,meta: {title: '密码修改'}},
                    {path: '/my', component: My,meta: {title: '个人信息'}},
                ]
            },
            {path: '/circumstance', component: Circumstance,meta: {title: '申报情况'}},
            {path: '/deptecharts', component: Deptecharts,meta: {title: '各系申报情况'}},
        ]
    },
    /*管理人员界面*/
    {
        path: '/adminHome', component: AdminHome,
        redirect: '/adminIndex',
        children: [
            {path: '/adminIndex', component: AdminIndex},
            {path: '/add_exa', component: Add_exa},
            {path: '/all', component: All},
        ]
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
